package com.ibeeking.found.open.api.feign;

import com.ibeeking.found.open.api.common.dto.ShopDTO;
import com.ibeeking.found.open.api.common.param.AppletsQrCodeParam;
import com.ibeeking.found.open.api.feign.fallback.SystemFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-system-c-server", path = "/c", contextId = "openSystemFeignClient", fallbackFactory = SystemFeignFallbackFactory.class, decode404 = true)
public interface SystemFeignClient {

    /**
     * 根据商户编码查询商户信息
     *
     * @param shopCode
     * @return
     */
    @PostMapping(value = "/shop/feign/v1/queryByShopCode/{shopCode}")
    ResponseResult<ShopDTO> queryByShopCode(@PathVariable("shopCode") String shopCode);

    /**
     * 根据商户编码查询商户信息
     *
     * @param shopCodes
     * @return
     */
    @PostMapping(value = "/shop/feign/v1/queryByShopCodes")
    ResponseResult<List<ShopDTO>> queryByShopCodes(@RequestBody List<String> shopCodes);

    /**
     * 场景小程序码
     *
     * @param param
     * @return
     */
    @PostMapping(value = "/wxQrCode/feign/v1/createSceneQR")
    feign.Response createSceneQR(@Validated AppletsQrCodeParam param);
}
